<template>
	<view>


	</view>
</template>

<script>
	import httpUtil from "@/utils/httpUtil";
	import commonApi from "@/api/commonApi";
	import userApi from "@/api/userApi";
	import backMiniApi from "../../api/backMiniApi";
	import logApi from "../../api/logApi";
	import paramApi from "../../api/paramApi";
	import {
product
	} from "../../api/index.js"
	export default {
		data() {
			return {

			}
		},
		onLoad(option) {
			console.log()
			this.initData(option)
		},

		methods: {
			initData(option) {


				paramApi.initData(option)
				if (!userApi.getUserId()) {
					userApi.initUserId()
				}
					
				if(httpUtil.getA()){
					console.log( httpUtil.getA(),222)
					product({
						a: httpUtil.getA(),
						env: 4,
						userid: userApi.getUserId()
					}).then((res) => {
						console.log(res.data.product_code)
						if (res.data.product_code == 'LH2509') {
							uni.reLaunch({
								url: '/pages/souhu_newtc/souhu_newtc?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						}
						if (res.data.product_code == 'LH2506') {
							uni.reLaunch({
								url: '/pages/youku_tcq2_full/youku_tcq2_full?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						}
						if (res.data.product_code == 'LH2511') {
							uni.reLaunch({
								url: '/pages/lbk_tcq/lbk_tcq?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						}
						if (res.data.product_code == 'ZY1504') {
							uni.reLaunch({
								url: '/pages/pzb_tcq/pzb_tcq?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						}
						if (res.data.product_code == 'LH2512') {
							uni.reLaunch({
								url: '/pages/xiaowu_gushi_ljj_full/xiaowu_gushi_ljj_full?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						}
						if (res.data.product_code == 'ZY1505') {
							uni.reLaunch({
								url: '/pages/chezhu/chezhu?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						} 
						if (res.data.product_code == 'LH2515') {
							uni.reLaunch({
								url: '/pages/lbkplus_tcq/lbkplus_tcq?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						} 
						if (res.data.product_code == 'ZY1508') {
							uni.reLaunch({
								url: '/pages/pz-szmf/pz-szmf?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						} 
						if (res.data.product_code == 'QT3501') {
							uni.reLaunch({
								url: '/pages/mayibao/mayibao?a=' + httpUtil.getA()+'&param='+userApi.getParam()
							})
							return
						} 
						
						else {
					
							let url =
								'https://kshk.91bak.com/zhiboclb/46/#/pages/llb/llb?media_id=422&ad_position_id=1341&a=' +
								httpUtil.getA()+'&param='+userApi.getParam()
							let link = "https://render.alipay.com/p/s/i/?scheme=" + encodeURIComponent(
									"alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode="
								) +
								encodeURIComponent(encodeURIComponent(url))
							my.ap.navigateToAlipayPage({
								path: link
							})
						}
					
					})
				}else{
					my.showToast({
						type: 'fail',
						content: '缺少a值',
						duration: 3000,
						success: () => {
					
						},
					});
				}
			

			},

		}
	}
</script>

<style lang="scss">

</style>
